(() => {
    class Model {
        // 构造方法
        constructor(name, value) {
            this.name = name;
            this.value = value;
        }
        // 成员函数
        sayHi() {
            console.log(`hello ${this.name}`);
        }
    }
    let m = new Model('yejing', 'guagnzhou');
    m.sayHi();
    // 继承
    class Animal {
        constructor(name, food) {
            this.name = name;
            this.food = food;
        }
        eat() {
            console.log(`${this.name} eat ${this.food}`);
        }
    }
    class Dog extends Animal {
    }
    let d = new Dog('旺财', '肉');
    d.eat();
    // 实现多个接口
    class Person {
        swim() {
            console.log('我是超人，我会游泳');
        }
        fly() {
            console.log('我是超人，我会飞');
        }
    }
    let a = new Person();
    a.fly();
    a.swim();
    class Person2 {
        swim() {
            console.log('我是超人2，我会游泳');
        }
        fly() {
            console.log('我是超人2，我会飞');
        }
    }
    let p3 = new Person2();
    p3.fly();
    p3.swim();
})();
